import requestI from '@/utils/request'
// 水务站点
// 根据ID删除数据
export function deleteSiteById(id) {
  return requestI({
    url: `/backend/site/delete/${id}`,
    method: 'delete'
  })
}
// 分页查询
export function getSiteByPage(data) {
  return requestI({
    url: `/backend/site/getByPage`,
    method: 'post',
    data
  })
}
// 根据ID获取数据
export function getSiteInfo(dataId) {
  return requestI({
    url: `/backend/site/getInfo/${dataId}`,
    method: 'get'
  })
}
// 保存数据
export function saveSiteId(data) {
  return requestI({
    url: `/backend/site/save`,
    method: 'post',
    data
  })
}
// 设备通道
// 通道绑定现场设备
export function bindRuleId(data) {
  return requestI({
    url: `/backend/dataRule/bindingDevice`,
    method: 'post',
    data
  })
}
// 数据类型说明
export function dataTypeRuleId(data) {
  return requestI({
    url: `/backend/dataRule/dataDescription`,
    method: 'post',
    data
  })
}
// 根据ID删除数据
export function deleteRuleById(id) {
  return requestI({
    url: `/backend/dataRule/delete/${id}`,
    method: 'delete'
  })
}
// 分页查询
export function getRuleByPage(data) {
  return requestI({
    url: `/backend/dataRule/getByPage`,
    method: 'post',
    data
  })
}
// 根据ID获取数据
export function getRuleInfo(dataId) {
  return requestI({
    url: `/backend/dataRule/getInfo/${dataId}`,
    method: 'get'
  })
}
// 保存数据
export function saveRuleId(data) {
  return requestI({
    url: `/backend/dataRule/save`,
    method: 'post',
    data
  })
}
// 设备列表
export function getRuleAllList(deviceId) {
  return requestI({
    url: `/backend/dataRule/getAll/${deviceId}`,
    method: 'get'
  })
}
// 数据传输设备
// 根据ID删除数据
export function deleteDtuById(id) {
  return requestI({
    url: `/backend/deviceDtu/delete/${id}`,
    method: 'delete'
  })
}
// 分页查询
export function getDtuByPage(data) {
  return requestI({
    url: `/backend/deviceDtu/getByPage`,
    method: 'post',
    data
  })
}
// 根据ID获取数据
export function getDtuInfo(dataId) {
  return requestI({
    url: `/backend/deviceDtu/getInfo/${dataId}`,
    method: 'get'
  })
}
// 保存数据
export function saveDtuId(data) {
  return requestI({
    url: `/backend/deviceDtu/save`,
    method: 'post',
    data
  })
}
// 设备列表
export function getDtuAllList() {
  return requestI({
    url: `/backend/deviceDtu/getAll`,
    method: 'get'
  })
}
// 现场设备
// 根据ID删除数据
export function deleteIndustryById(id) {
  return requestI({
    url: `/backend/deviceIndustry/delete/${id}`,
    method: 'delete'
  })
}
// 分页查询
export function getIndustryByPage(data) {
  return requestI({
    url: `/backend/deviceIndustry/getByPage`,
    method: 'post',
    data
  })
}
// 按照现场设备查询
export function getIndustryDevicePage(data) {
  return requestI({
    url: `/backend/deviceIndustry/getDeviceInfoRule`,
    method: 'post',
    data
  })
}
// 根据ID获取数据
export function getIndustryInfo(dataId) {
  return requestI({
    url: `/backend/deviceIndustry/getInfo/${dataId}`,
    method: 'get'
  })
}
// 保存数据
export function saveIndustryId(data) {
  return requestI({
    url: `/backend/deviceIndustry/save`,
    method: 'post',
    data
  })
}
// 设备列表
export function getIndustryAllList(siteId) {
  return requestI({
    url: `/backend/deviceIndustry/getAll/${siteId}`,
    method: 'get'
  })
}



// 现场设备通道
// 根据ID删除数据
export function deleteIndustryRuleById(id) {
  return requestI({
    url: `/backend/deviceIndustryRule/delete/${id}`,
    method: 'delete'
  })
}
// 批量删除数据
export function deleteIndustryRuleByIds(ids) {
  return requestI({
    url: `/backend/deviceIndustryRule/deleteAll/${ids}`,
    method: 'delete'
  })
}
// 分页查询
export function getIndustryRuleByPage(data) {
  return requestI({
    url: `/backend/deviceIndustryRule/getByPage`,
    method: 'post',
    data
  })
}
// 根据ID获取数据
export function getIndustryRuleInfo(dataId) {
  return requestI({
    url: `/backend/deviceIndustryRule/getInfo/${dataId}`,
    method: 'get'
  })
}
// 获取未配置通道
export function saveIndustryRuleId(deviceId) {
  return requestI({
    url: `/backend/deviceIndustryRule/getDataRule/${deviceId}`,
    method: 'get'
  })
}
// 批量保存数据
export function saveIndustryRuleIds(data) {
  return requestI({
    url: `/backend/deviceIndustryRule/saveAll`,
    method: 'post',
    data
  })
}


// 历史数据
/*数据分页查询*/
export function getHistoryByPage(data) {
  return requestI({
    url: `/backend/dataAll/getByPage`,
    method: 'post',
    data
  })
}
/*曲线分析*/
export function getHistoryCurve(data) {
  return requestI({
    url: `/backend/dataAll/curveAnalysis`,
    method: 'post',
    timeout: 200000,
    data
  })
}
/*极值查询*/
export function getHistoryPeak(data) {
  return requestI({
    url: `/backend/dataAll/getPeakData`,
    method: 'post',
    data
  })
}
// 实时数据
/*数据分页查询*/
export function getActualByPage(data) {
  return requestI({
    url: `/backend/dataRealtime/getByPage`,
    method: 'post',
    data
  })
}
// 按照设备分页查询
export function getActualPages(data) {
  return requestI({
    url: `/backend/dataRealtime/getDeviceByPage`,
    method: 'post',
    data
  })
}
// 按照现场设备分页查询
export function getActualIndustryPages(data) {
  return requestI({
    url: `/backend/dataRealtime/getIndustryDeviceByPage`,
    method: 'post',
    data
  })
}
// 根据ID获取数据
export function getActualInfo(dataId) {
  return requestI({
    url: `/backend/dataRealtime/getInfo/${dataId}`,
    method: 'get'
  })
}
// 设备列表
export function getActualDevice(data) {
  return requestI({
    url: `/backend/dataRealtime/getDeviceAll`,
    method: 'post',
    data
  })
}
// 设备下通道信息列表
export function getActualRuleInfo(data) {
  return requestI({
    url: `/backend/dataRealtime/getDeviceRuleInfoAll`,
    method: 'post',
    data
  })
}
// 告警实时数据
// 分页查询
export function getAlarmPages(data) {
  return requestI({
    url: `/backend/dataRealtimeAlarm/getByPage`,
    method: 'post',
    data
  })
}
// 告警历史数据
// 分页查询
export function getAlarmHistory(data) {
  return requestI({
    url: `/backend/dataAlarmAll/getByPage`,
    method: 'post',
    data
  })
}
// 30天告警趋势分析
export function getAlarmHistoryTrend(data) {
  return requestI({
    url: `/backend/dataAlarmAll/alarmTrend`,
    method: 'post',
    data
  })
}
// 告警类型占比
export function getAlarmHistoryType(data) {
  return requestI({
    url: `/backend/dataAlarmAll/alarmTypeRatio`,
    method: 'post',
    data
  })
}
